package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.ApplyForMapper;
import com.jiyun.pojo.ApplyFor;
import com.jiyun.service.ApplyForService;
import com.jiyun.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApplyForServiceImpl extends ServiceImpl<ApplyForMapper, ApplyFor> implements ApplyForService {

    @Autowired
    ApplyForMapper applyForMapper;
    @Override
    public R addApply(ApplyFor applyFor) {
        applyFor.setStatus(0);
        applyForMapper.insert(applyFor);
        return R.ok();
    }

    @Override
    public R findApplyfor() {
        List<ApplyFor> list = applyForMapper.selectList(null);
        return R.ok().data("list",list);
    }

    @Override
    public R deleteApply(Integer id) {
        applyForMapper.deleteById(id);
        return R.ok();
    }
}
